package com.common.log.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
 * 审计日志配置
 */
@Setter
@Getter

/** Comment:
 * 1.需要添加坐标
     <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
    2.需要在启动类上配置:比@Component注入的好处是可以通过配置文件进行修改（动态修改+RefreshScope即可）
        @EnableConfigurationProperties({TraceProperties.class, AuditLogProperties.class})
 */
@ConfigurationProperties(prefix = "common.audit-log")
/** Comment:
 * 需要添加坐标
     <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-context</artifactId>
     </dependency>
 */
@RefreshScope
public class AuditLogProperties {
    /**
     * 是否开启审计日志
     */
    private Boolean enabled = false;
    /**
     * 日志记录类型(logger/redis/db/es)
     */
    private String logType;
}
